package com.jion.testcenter.mapper;

import com.jion.testcenter.Entity.ConfEntity;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Controller;
import java.util.List;

@Controller

@Mapper
public interface InterfaceMapper {
    /******测试环境   *****/
    @Insert("insert into envconf (name,ipaddr,host)VALUES(#{name},#{ipaddr},#{host})")
    int insertEnv(ConfEntity confEntity);

    @Update("Update envconf set name = #{name},ipaddr=#{ipaddr},status=#{status},host=#{host} where id=#{id}")
    int updateEnv(ConfEntity confEntity);

    @Select("select * from envconf")
    List<ConfEntity> selectEnv();
    @Delete("delete from envconf where id=#{id}")
    int delectEnv( String id);
    @Select("select * from envconf where id = #{id}")
    ConfEntity selectOneEnv(@Param("id")String id);

    /*****项目的数据库*******/
    @Insert("insert into mysqlConf (hostName,passWord,port,userName,baseName)VALUES(#{hostName},#{passWord},#{port},#{userName},#{baseName})")
    int insertMysqlConf(ConfEntity confEntity);
    @Select("select * from mysqlConf")
    List<ConfEntity> selectMysqlConf();
    @Select("select * from mysqlConf where mysqlID = #{mysqlID}")
    ConfEntity selectOneMysqlConf(String mysqlID);
    @Delete("delete from mysqlConf where mysqlID=#{mysqlID}")
    int delectMysqlConf( String mysqlID);

    @Update("update mysqlConf set hostName=#{hostName},passWord=#{passWord},port=#{port},userName=#{userName},baseName=#{baseName} where mysqlID=#{mysqlID}")
    int updateMysqlConf(ConfEntity confEntity);

}
